<?php
header('content-Type: application/json');
$username = $_POST['username'];
$password = $_POST['password'];

$result['result']=1;
$result['msg']='success';

$userinfo['username']=$username;
$userinfo['password']=$password;
$result['userinfo']=$userinfo;

$hobby[0]['hbid']='1';
$hobby[0]['hbname']='swimming';
$hobby[1]['hbid']='2';
$hobby[1]['hbname']='walking';
$hobby[2]['hbid']='3';
$hobby[2]['hbname']='playing games';
$hobby[3]['hbid']='4';
$hobby[3]['hbname']='singing';
$result['hobby']=$hobby;

echo json_encode($result);

?>